<template>
  <div id="app">
    <el-button @click="setLang" size="mini">切换语言</el-button>
    <el-container>
      <el-aside width="200px">
        <el-menu class="el-menu-vertical-demo" :router="true">
          <el-menu-item index="demo_1">列表&弹窗&组件之间的通信</el-menu-item>
          <el-menu-item index="demo_2">组件封装</el-menu-item>
          <el-menu-item index="demo_3">计算属性</el-menu-item>
          <el-menu-item index="demo_4">监听属性</el-menu-item>
          <el-menu-item index="demo_5">动态绑定class</el-menu-item>
          <el-menu-item index="demo_6">列表渲染 & 条件渲染</el-menu-item>
          <el-menu-item index="demo_7">动态组件</el-menu-item>
          <el-menu-item index="demo_8">混入</el-menu-item>
          <el-menu-item index="demo_9">混入_2</el-menu-item>
          <el-menu-item index="demo_10">VUEX状态管理</el-menu-item>
        </el-menu>
      </el-aside>
      <el-main>
        <router-view />
      </el-main>
    </el-container>
  </div>
</template>

<script>
export default {
  name: "App",
  methods: {
    setLang() {
      this.$i18n.locale = this.$i18n.locale === "zh" ? "en" : "zh";
    },
  },
};
</script>

<style lang="scss">
html,
body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  // text-align: center;
  color: #2c3e50;
  height: 100%;
  width: 100%;
  .el-container {
    height: 100%;
    width: 100%;
    .el-aside {
      .el-menu-vertical-demo {
        height: 100%;
        background-color: #f5f5f5;
      }
    }
  }
}

nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
